login = function () {
    var username = document.getElementById("username").value;
    var password = document.getElementById("password").value;
    axios.get("http://localhost:8080/JWGLSystem/loginServlet?username=" + username + "&password=" + password).then(function (resp) {
        if (resp.data == "success") {
            window.location.href = "other/homePage.html"
        } else {
            document.getElementById("error").style.display = "block";
        }
    });
}

var number;

ggfb = function () {
    window.location.href = "homePageAddAnn.html"
}

cjcx = function () {
    window.location.href = "homePageSelectScore.html"
}

kccx = function () {
    window.location.href = "homePageSelectCourse.html"
}

ggcx = function () {
    window.location.href = "homePageSelectAnn.html"
}

kcgl = function () {
    window.location.href = "homePageManageCourse.html"
}

sy = function () {
    window.location.href = "homePage.html"
}

glxs = function () {
    window.location.href = "homePageManageStudents.html"
}

gljs = function () {
    window.location.href = "homePageManageTeacher.html"
}

//显示成员名单页面
refreshPersonPage = function (num) {
    //初始化数据
    number = num;
    var data =
        "<div id=\"Page_right_manageStudents_bottom_markStudents\">\n" +
        "                <table border=\"1\" style=\"border-collapse: collapse;text-align: center;\">\n" +
        "                    <tr>\n" +
        "                        <th>id</th>\n" +
        "                        <th>用户名</th>\n" +
        "                        <th>密码</th>\n" +
        "                        <th>班级号</th>\n" +
        "                        <th>年龄</th>\n" +
        "                        <th>生日</th>\n" +
        "                        <th colspan = 2>修改</th>\n" +
        "                    </tr>";

    //向服务器发送axios请求
    axios.get("http://localhost:8080/JWGLSystem/managePersonServlet0?id=" + num).then(function (resp) {
        for (let i = 0; i < resp.data.length; i++) {
            data += "<tr>\n" +
                "    <td>" + (resp.data[i].id == undefined ? "未填写" : resp.data[i].id) + " </td>\n" +
                "    <td>" + (resp.data[i].userName == undefined ? "未填写" : resp.data[i].userName) + "  </td>\n" +
                "    <td>" + (resp.data[i].userPassword == undefined ? "未填写" : resp.data[i].userPassword) + "   </td>\n" +
                "    <td>" + (resp.data[i].userClassId == undefined ? "未填写" : resp.data[i].userClassId) + "   </td>\n" +
                "    <td>" + (resp.data[i].userAge == undefined ? "未填写" : resp.data[i].userAge) + "      </td>\n" +
                "    <td>" + (resp.data[i].userBirthday == undefined ? "未填写" : resp.data[i].userBirthday) + "    </td>\n" +
                "    <td class = 'Page_right_manageStudents_bottom_ManageStudentBtn' onclick = compileStudents(" + resp.data[i].id + ")>编辑</td>\n" +
                "    <td class = 'Page_right_manageStudents_bottom_ManageStudentBtn' onclick = delectStudents(" + resp.data[i].id + ")>删除</td>\n" +
                "</tr>";
        }
        //拼接上传数据
        document.getElementById("Page_right_manageStudents_bottom").innerHTML =
            data + "\n" +
            "                </table>\n" +
            "            </div>" +
            "<div id=\"Page_right_manageStudents_bottom_changeStudentsInfo\">\n" +
            "<span id = Page_right_manageStudents_bottom_AddStudents_clock onclick=clockChangeStudentsInfo()>X</span>\n" +
            "    <input id = 'Page_right_manageStudents_bottom_changeStudentsInfo_input-1' type=\"text\">\n" +
            "    <div id=\"Page_right_manageStudents_bottom_changeStudentsInfo_AddStudents0\">\n" +
            "       <span>用&nbsp;&nbsp;户&nbsp;&nbsp;名</span>\n" +
            "       <input id = 'Page_right_manageStudents_bottom_changeStudentsInfo_input0' type=\"text\">\n" +
            "      </div>\n" +
            "      <div id=\"Page_right_manageStudents_bottom_changeStudentsInfo_AddStudents1\">\n" +
            "       <span>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码</span>\n" +
            "       <input  id = 'Page_right_manageStudents_bottom_changeStudentsInfo_input1'  type=\"text\">\n" +
            "      </div>\n" +
            "      <div id=\"Page_right_manageStudents_bottom_changeStudentsInfo_AddStudents1\">\n" +
            "       <span>所属班级</span>\n" +
            "       <input  id = 'Page_right_manageStudents_bottom_changeStudentsInfo_input2'  type=\"text\">\n" +
            "      </div>\n" +
            "      <div id=\"Page_right_manageStudents_bottom_changeStudentsInfo_AddStudents1\">\n" +
            "       <span>年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;龄</span>\n" +
            "       <input  id = 'Page_right_manageStudents_bottom_changeStudentsInfo_input3'  type=\"text\">\n" +
            "      </div>\n" +
            "      <div id=\"Page_right_manageStudents_bottom_changeStudentsInfo_AddStudents1\">\n" +
            "       <span>生&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;日</span>\n" +
            "       <input  id = 'Page_right_manageStudents_bottom_changeStudentsInfo_input4'  type=\"text\">\n" +
            "      </div>\n" +
            "      <div id=\"Page_right_manageStudents_bottom_changeStudentsInfo_AddStudents2\">\n" +
            "       <button id='Page_right_manageStudents_bottom_changeStudentsInfo_updattInfo' onclick = updateInfo()>提交修改</button>\n" +
            "      </div>\n";
    });
}

addPersionPage = function () {
    var str = "<div id=\"Page_right_manageStudents_bottom_AddStudents\">\n" +
        "          <div id=\"Page_right_manageStudents_bottom_AddStudents0\">\n" +
        "              <span>用&nbsp;&nbsp;户&nbsp;&nbsp;名</span>\n" +
        "              <input type=\"text\">\n" +
        "          </div>\n" +
        "          <div id=\"Page_right_manageStudents_bottom_AddStudents1\">\n" +
        "              <span>所属班级</span>\n" +
        "              <input type=\"text\">\n" +
        "          </div>\n" +
        "          <div id=\"Page_right_manageStudents_bottom_AddStudents1\">\n" +
        "              <span>年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;龄</span>\n" +
        "              <input type=\"text\">\n" +
        "          </div>\n" +
        "          <div id=\"Page_right_manageStudents_bottom_AddStudents1\">\n" +
        "              <span>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别</span>\n" +
        "              <input type=\"text\">\n" +
        "          </div>\n" +
        "          <div id=\"Page_right_manageStudents_bottom_AddStudents1\">\n" +
        "              <span>生&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;日</span>\n" +
        "              <input type=\"text\">\n" +
        "          </div>\n";
    if (number == 0) {
        str += "          <div id=\"Page_right_manageStudents_bottom_AddStudents2\">\n" +
            "              <button onclick=addPerson(0)>添加学生</button>\n" +
            "          </div>\n" +
            "      </div>";
    } else {
        str += "          <div id=\"Page_right_manageStudents_bottom_AddStudents2\">\n" +
            "              <button onclick=addPerson(1)>添加教师</button>\n" +
            "          </div>\n" +
            "      </div>";
    }
    document.getElementById("Page_right_manageStudents_bottom").innerHTML = str;
}

select = function (num) {
    axios.post("http://localhost:8080/JWGLSystem/homePageServletGG").then(function (resp) {
        // console.log(resp.data[resp.data.length-num-1]);
        // console.log(resp.data[resp.data.length-num-1].annContent);
        // console.log(resp.data[resp.data.length-num-1].annDate);

        document.getElementById("Page_right_tabulation_title").innerHTML = resp.data[resp.data.length - num - 1].annTitle;
        document.getElementById("Page_right_tabulation_info").innerHTML = resp.data[resp.data.length - num - 1].annContent;
        document.getElementById("Page_right_tabulation_date_font").innerHTML = resp.data[resp.data.length - num - 1].annDate;
    });
}

submit = function () {
    var add_ann_title = document.getElementById("add_ann_title").value;
    var add_ann_content = document.getElementById("add_ann_content").value;
    if (add_ann_title == "" || add_ann_content == "") {
        alert("公告标题或公告内容不可为空");
    } else {
        var date = new Date();
        var announcement = {
            annTitle: add_ann_title,
            annContent: add_ann_content,
            anndate: date.toLocaleString()
        }

        axios.post("http://localhost:8080/JWGLSystem/homePageAddAnnServlet", announcement).then(function (resp) {
            alert(resp.data);
        })
    }
}

selectScore = function () {
    var selectid;
    if (userp == "学生") {
        selectid = userid;
    } else {
        selectid = document.getElementById("Page_right_module_selectCourse_top_writeClass").value;
    }

    axios.get("http://localhost:8080/JWGLSystem/homePageSelectScoreServlet?id=" + selectid).then(function (resp) {
        if (resp.data == "") {
            document.getElementById("Page_right_module_selectCourse_bottom").innerHTML = " <div id=\"Page_right_module_selectCourse_bottom_noCourse\">\n" +
                "                没有查询到选择的课程\n" +
                "            </div>";
        } else {
            var data =
                "<div id=Page_right_module_selectCourse_bottom_haveCourse>" +
                "<table border=\"1\" style=\"border-collapse: collapse;text-align: center;\">\n" +
                "<tr>\n" +
                "    <th>id</th>\n" +
                "    <th>学号</th>\n" +
                "    <th>班级</th>\n" +
                "    <th>课程号</th>\n" +
                "    <th>课程名</th>\n" +
                "    <th>成绩</th>\n" +
                "</tr>\n";

            for (var i = 0; i < resp.data.length; i++) {
                data += "<tr>\n" +
                    "    <td>" + resp.data[i].id + "</td>\n" +
                    "    <td>" + resp.data[i].userName + "</td>\n" +
                    "    <td>" + resp.data[i].userClassId + "</td>\n" +
                    "    <td>" + resp.data[i].courseId + "</td>\n" +
                    "    <td>" + resp.data[i].courseName + "</td>\n" +
                    "    <td>" + (resp.data[i].scoreNum == 0 ? "未打分" : resp.data[i].scoreNum) + "</td>\n" +
                    "</tr>\n"
            }

            var formdata = data + "</table>\n" + "</div>\n";

            document.getElementById("Page_right_module_selectCourse_bottom").innerHTML = data;
        }
    });
}

selectAllCourse = function () {
    axios.post("http://localhost:8080/JWGLSystem/selectAllCourseServlet").then(function (resp) {
        var data =
            "<div id = 'Page_right_selectCourse_bottom_haveCourse'>" +
            "<table border=\"1\" style=\"border-collapse: collapse;text-align: center;\">\n" +
            "                <tr>\n" +
            "                    <th>课程号</th>\n" +
            "                    <th>课程名</th>\n" +
            "                </tr>\n";

        for (var i = 0; i < resp.data.length; i++) {
            data +=
                "<tr>\n" +
                "    <td>" + resp.data[i].courseId + "</td>\n" +
                "    <td>" + resp.data[i].courseName + "</td>\n" +
                "</tr>\n"
        }

        var formdata = data + "</table>\n" + "</div>\n";

        document.getElementById("Page_right_selectCourse_bottom").innerHTML = data;
    });
}

selectMyCourse = function () {
    axios.post("http://localhost:8080/JWGLSystem/selectMyCourseServlet", id).then(function (resp) {
        if (resp.data != "") {
            var data =
                "<div id = 'Page_right_selectCourse_bottom_haveCourse'>" +
                "<table border=\"1\" style=\"border-collapse: collapse;text-align: center;\">\n" +
                "                <tr>\n" +
                "                    <th>课程号</th>\n" +
                "                    <th>课程名</th>\n" +
                "                </tr>\n";
            for (var i = 0; i < resp.data.length; i++) {
                data +=
                    "<tr>\n" +
                    "    <td>" + resp.data[i].courseId + "</td>\n" +
                    "    <td>" + resp.data[i].courseName + "</td>\n" +
                    "</tr>\n"
            }

            var formdata = data + "</table>\n" + "</div>\n";

            document.getElementById("Page_right_selectCourse_bottom").innerHTML = data;
        } else {
            document.getElementById("Page_right_selectCourse_bottom").innerHTML =
                "<div id=\"Page_right_selectCourse_bottom_noCourse\">\n" +
                "                您没有选择课程\n" +
                "            </div>"
        }
    });
}

selectMyNoCourse = function () {
    axios.post("http://localhost:8080/JWGLSystem/selectMyNoCourseServlet", id).then(function (resp) {
        if (resp.data != "") {
            var data =
                "<div id = 'Page_right_selectCourse_bottom_haveCourse'>" +
                "<table border=\"1\" style=\"border-collapse: collapse;text-align: center;\">\n" +
                "                <tr>\n" +
                "                    <th>课程号</th>\n" +
                "                    <th>课程名</th>\n" +
                "                    <th>选课</th>\n" +
                "                </tr>\n";
            for (var i = 0; i < resp.data.length; i++) {
                data +=
                    "<tr>\n" +
                    "    <td>" + resp.data[i].courseId + "</td>\n" +
                    "    <td>" + resp.data[i].courseName + "</td>\n" +
                    "    <td class = 'xuanke' onclick = " + "xuanke(" + resp.data[i].courseId + "," + id + ")" + ">" + "选择" + "</td>\n" +
                    "</tr>\n"
            }

            var formdata = data + "</table>\n" + "</div>\n";

            document.getElementById("Page_right_selectCourse_bottom").innerHTML = data;
        } else {
            document.getElementById("Page_right_selectCourse_bottom").innerHTML =
                "<div id=\"Page_right_selectCourse_bottom_noCourse\">\n" +
                "                您没有未选的课程\n" +
                "            </div>"
        }
    });
}

xuanke = function (courseId, id) {
    var data = {
        courseId: courseId,
        id: id
    }
    axios.post("http://localhost:8080/JWGLSystem/addCourseServlet", data).then(function (resp) {
        axios.post("http://localhost:8080/JWGLSystem/selectMyNoCourseServlet", id).then(function (resp) {
            if (resp.data != "") {
                var data =
                    "<div id = 'Page_right_selectCourse_bottom_haveCourse'>" +
                    "<table border=\"1\" style=\"border-collapse: collapse;text-align: center;\">\n" +
                    "                <tr>\n" +
                    "                    <th>课程号</th>\n" +
                    "                    <th>课程名</th>\n" +
                    "                    <th>选课</th>\n" +
                    "                </tr>\n";
                for (var i = 0; i < resp.data.length; i++) {
                    data +=
                        "<tr>\n" +
                        "    <td>" + resp.data[i].courseId + "</td>\n" +
                        "    <td>" + resp.data[i].courseName + "</td>\n" +
                        "    <td class = 'xuanke' onclick = " + "xuanke(" + resp.data[i].courseId + "," + id + ")" + ">" + "选择" + "</td>\n" +
                        "</tr>\n"
                }

                var formdata = data + "</table>\n" + "</div>\n";

                document.getElementById("Page_right_selectCourse_bottom").innerHTML = data;
            } else {
                document.getElementById("Page_right_selectCourse_bottom").innerHTML =
                    "<div id=\"Page_right_selectCourse_bottom_noCourse\">\n" +
                    "                您没有未选的课程\n" +
                    "            </div>"
            }
        });
        alert(resp.data);
    });
}

addCourse = function () {
    // alert("addCourse");
    var data =
        "<div id=\"Page_right_manageCourse_bottom_AddCourse\">\n" +
        "    <div id=\"Page_right_manageCourse_bottom_AddCourse0\">\n" +
        "        <span>课&nbsp;&nbsp;程&nbsp;&nbsp;号</span>\n" +
        "        <input type=\"text\" id='input0'>\n" +
        "    </div>\n" +
        "    <div id=\"Page_right_manageCourse_bottom_AddCourse1\">\n" +
        "        <span>课程名称</span>\n" +
        "        <input type=\"text\" id='input1'>\n" +
        "    </div>\n" +
        "    <div id=\"Page_right_manageCourse_bottom_AddCourse2\">\n" +
        "        <button onclick=addCourseUp(input0.value,input1.value)>添加课程</button>\n" +
        "    </div>\n" +
        "</div>";
    document.getElementById("Page_right_manageCourse_bottom").innerHTML = data;
}

markOfId = function () {
    id = document.getElementById("Page_right_manageCourse_top_mark_markOfId_input").value;

    axios.get("http://localhost:8080/JWGLSystem/homePageManageCourse1?id=" + id).then(function (resp) {
        if (resp.data == "") {
            document.getElementById("Page_right_manageCourse_bottom").innerHTML =
                "<div id=\"Page_right_manageCourse_bottom_noCourse\">\n" +
                "                未查询到相关数据\n" +
                "</div>";
        } else {
            var data = "<div id=\"Page_right_manageCourse_bottom_markCourse\">\n" +
                "        <table border=\"1\" style=\"border-collapse: collapse;text-align: center;\">\n" +
                "            <tr>\n" +
                "                <th>学号</th>\n" +
                "                <th>姓名</th>\n" +
                "                <th>课程号</th>\n" +
                "                <th>课程名</th>\n" +
                "                <th>成绩</th>\n" +
                "                <th>打分</th>\n" +
                "            </tr>\n";

            for (let i = 0; i < resp.data.length; i++) {
                data +=
                    "<tr>\n" +
                    "    <td>" + resp.data[i].id + "</td>\n" +
                    "    <td>" + resp.data[i].userName + "</td>\n" +
                    "    <td>" + resp.data[i].courseId + "</td>\n" +
                    "    <td>" + resp.data[i].courseName + "</td>\n" +
                    "    <td>" + (resp.data[i].scoreNum >= 0 ? resp.data[i].scoreNum : "未打分") + "</td>\n" +
                    "    <td class=giveScore onclick = giveScore(" + resp.data[i].courseId + ',' + resp.data[i].id + ")>" + (resp.data[i].scoreNum >= 0 ? "重新打分" : "打分") + "</td>\n" +
                    "</tr>\n";
            }

            document.getElementById("Page_right_manageCourse_bottom").innerHTML = data +
                "</table>\n" +
                "</div>\n";
        }
    })
}

markOfCourseId = function () {
    CourseId = document.getElementById("Page_right_manageCourse_top_mark_markOfCourseId_input").value;

    axios.get("http://localhost:8080/JWGLSystem/homePageManageCourse2?CourseId=" + CourseId).then(function (resp) {
        if (resp.data == "") {
            document.getElementById("Page_right_manageCourse_bottom").innerHTML =
                "<div id=\"Page_right_manageCourse_bottom_noCourse\">\n" +
                "                未查询到相关数据\n" +
                "</div>";
        } else {
            var data = "<div id=\"Page_right_manageCourse_bottom_markCourse\">\n" +
                "        <table border=\"1\" style=\"border-collapse: collapse;text-align: center;\">\n" +
                "            <tr>\n" +
                "                <th>学号</th>\n" +
                "                <th>姓名</th>\n" +
                "                <th>课程号</th>\n" +
                "                <th>课程名</th>\n" +
                "                <th>成绩</th>\n" +
                "                <th>打分</th>\n" +
                "            </tr>\n";

            for (let i = 0; i < resp.data.length; i++) {
                data +=
                    "<tr>\n" +
                    "    <td>" + resp.data[i].id + "</td>\n" +
                    "    <td>" + resp.data[i].userName + "</td>\n" +
                    "    <td>" + resp.data[i].courseId + "</td>\n" +
                    "    <td>" + resp.data[i].courseName + "</td>\n" +
                    "    <td>" + (resp.data[i].scoreNum >= 0 ? resp.data[i].scoreNum : "未打分") + "</td>\n" +
                    "    <td class = giveScore onclick = giveScore(" + resp.data[i].courseId + ',' + resp.data[i].id + ")>" + (resp.data[i].scoreNum >= 0 ? "重新打分" : "打分") + "</td>\n" +
                    "</tr>\n";
            }

            document.getElementById("Page_right_manageCourse_bottom").innerHTML = data +
                "</table>\n" +
                "</div>\n";
        }
    })
}

addCourseUp = function (courseId, courseName) {
    axios.post("http://localhost:8080/JWGLSystem/homePageManageCourse0", courseId + " " + courseName).then(function (resp) {
        alert(resp.data);
        input0.value = "";
        input1.value = "";
    });
}

giveScore = function (CourseId, id) {
    var score = prompt("请输入成绩");
    axios.get("http://localhost:8080/JWGLSystem/homePageManageCourse3?CourseId=" + CourseId + "&id=" + id + "&score=" + score).then(function (resp) {
        alert(resp.data);
        document.getElementById("Page_right_manageCourse_bottom").innerHTML =
            "<div id=\"Page_right_manageCourse_bottom_noCourse\">\n" +
            "                数据添加成功\n" +
            "</div>";
    });
}

//添加成员
addPerson = function (num) {
    var name = document.getElementById("Page_right_manageStudents_bottom_AddStudents").getElementsByTagName("input")[0].value;
    var classId = document.getElementById("Page_right_manageStudents_bottom_AddStudents").getElementsByTagName("input")[1].value;
    var age = document.getElementById("Page_right_manageStudents_bottom_AddStudents").getElementsByTagName("input")[2].value;
    var sex = document.getElementById("Page_right_manageStudents_bottom_AddStudents").getElementsByTagName("input")[3].value;
    var birthday = document.getElementById("Page_right_manageStudents_bottom_AddStudents").getElementsByTagName("input")[4].value;
    var data = {
        userName: name,
        userClassId: classId,
        userAge: age,
        userSex: sex,
        userBirthday: birthday,
        userPost: num
    };
    axios.post("http://localhost:8080/JWGLSystem/managePersonServlet1", data).then(function (resp) {
        alert(resp.data);
    });
}

//实现删除成员信息按钮
delectStudents = function (id) {
    var count = confirm("确认删除" + id + "号学生吗?");
    // console.log(count);
    if (count == true) {
        axios.get("http://localhost:8080/JWGLSystem/manageStudentsServlet2?id=" + id).then(function (resp) {
            alert(resp.data);
            refreshPersonPage(number);
        });
    }
}

//实现编辑学生信息按钮
compileStudents = function (id) {
    axios.get("http://localhost:8080/JWGLSystem/homePageChangeInfo?id=" + id).then(function (resp) {
        // console.log(resp.data);
        document.getElementById("Page_right_manageStudents_bottom_changeStudentsInfo_input-1").value = resp.data.id;
        document.getElementById("Page_right_manageStudents_bottom_changeStudentsInfo_input0").value = (resp.data.userName == undefined ? "未填写" : resp.data.userName);
        document.getElementById("Page_right_manageStudents_bottom_changeStudentsInfo_input1").value = (resp.data.userPassword == undefined ? "未填写" : resp.data.userPassword);
        document.getElementById("Page_right_manageStudents_bottom_changeStudentsInfo_input2").value = (resp.data.userClassId == undefined ? "未填写" : resp.data.userClassId);
        document.getElementById("Page_right_manageStudents_bottom_changeStudentsInfo_input3").value = (resp.data.userAge == undefined ? "未填写" : resp.data.userAge);
        document.getElementById("Page_right_manageStudents_bottom_changeStudentsInfo_input4").value = (resp.data.userBirthday == undefined ? "未填写" : resp.data.userBirthday);
        document.getElementById("Page_right_manageStudents_bottom_changeStudentsInfo").style.display = "block";
    });

}

//关闭修改学学生信息页面
clockChangeStudentsInfo = function () {
    document.getElementById("Page_right_manageStudents_bottom_changeStudentsInfo").style.display = "none";
}

//上传修改信息
updateInfo = function () {
    var id = document.getElementById("Page_right_manageStudents_bottom_changeStudentsInfo_input-1").value;
    var userName = document.getElementById("Page_right_manageStudents_bottom_changeStudentsInfo_input0").value;
    var userPassWord = document.getElementById("Page_right_manageStudents_bottom_changeStudentsInfo_input1").value;
    var userClassId = document.getElementById("Page_right_manageStudents_bottom_changeStudentsInfo_input2").value;
    var userAge = document.getElementById("Page_right_manageStudents_bottom_changeStudentsInfo_input3").value;
    var userBirthday = document.getElementById("Page_right_manageStudents_bottom_changeStudentsInfo_input4").value;

    var data = {
        id: (id == "未填写" ? null : id),
        userName: (userName == "未填写" ? null : userName),
        userPassWord: (userPassWord == "未填写" ? null : userPassWord),
        userClassId: (userClassId == "未填写" ? null : userClassId),
        userAge: (userAge == "未填写" ? null : userAge),
        userBirthday: (userBirthday == "未填写" ? null : userBirthday)
    };
    axios.post("http://localhost:8080/JWGLSystem/homePageUpdateInfoServlet", data).then(function (resp) {
        alert(resp.data);
        document.getElementById("Page_right_manageStudents_bottom_changeStudentsInfo").style.display = "none";
        refreshPersonPage(number);
    });
}

//刷新首页"一言"
var arr = ["承君此诺 必守一生", "Hello,World!", "青青子衿 悠悠我心", "知我者 谓我心忧", "不知我者 谓我何求", "丈夫志四海 万里犹比邻", "黄沙百战穿金甲 不破楼兰终不还", "但愿人长久 千里共婵娟", "千磨万击还坚劲 任尔东西南北风", "明日复明日 明日何其多", "Melody!!!"];
var refreshNums = 1;
var refreshNum = 1;
refresh = function () {
    while (refreshNums * 10 == refreshNum * 10) {
        refreshNum = Math.random() * 10;
    }
    console.log(refreshNums*10,refreshNum*10)
    refreshNums = refreshNum;
    var ran = Math.round(refreshNum);
    document.getElementById("wisdom").innerHTML = arr[ran];
}